#ifndef CQuaternion_____
#define CQuaternion_____

#include "Vector3f.h"
#include "Matrix44f.h"

class CQuaternion
{
  public:

	//-------------------------------------------------------------------------
	// members
	//-------------------------------------------------------------------------

	float w;
	vector3f v;

	//-------------------------------------------------------------------------
	// constructors
	//-------------------------------------------------------------------------

	CQuaternion();
	CQuaternion(float w_, float x_, float y_, float z_);
	CQuaternion(float w_, vector3f v_);

	//-------------------------------------------------------------------------
	// member functions
	//-------------------------------------------------------------------------

	float Magnitude();
	float MagnitudeSquared();
	void Normalize();
	void Set(float w_, float x_, float y_, float z_);
	void Set(float w_, vector3f v_);
	void EulerAnglesToQuat(float x, float y, float z);
	void QuatToAngleAxis(vector3f &axis, float &angle);
	void AngleAxisToQuat(vector3f axis, float angle);
	void QuatToRotationMatrix(matrix44f &rmatrix);

	//-------------------------------------------------------------------------
	// overloaded operators
	//-------------------------------------------------------------------------

	CQuaternion operator * (const CQuaternion q);
	CQuaternion operator *= (const CQuaternion q);
	void operator = (const CQuaternion q);

};

#endif